<template>
  <div>
    <!-- 可以直接在 store 实例上访问 getter -->
    <p>doubleCount getter: {{ store.doubleCount }}</p>
    <p>doublePlusOne getter: {{ store.doublePlusOne }}</p>
    <p>doubleCountPlusOne getter: {{ store.doubleCountPlusOne }}</p>
    <p>getUserById getter: {{ store.getUserById(2) }}</p>
    <p>otherGetter getter: {{ store.otherGetter }}</p>
  </div>
</template>

<script setup>
import { useStore } from '@/store/index'

const store = useStore()
console.log(store.doubleCount) // 可以直接访问任何 getter 作为 store 的属性（与 state 属性完全一样）
</script>

<style scoped>

</style>